import java.io.File;


public class RecursionLab {
	
	public static int power(int a, int b)
	{
		if (b == 0)
			return 1;
		return a * power(a, b-1);
	}
	
	public static int mysterySeries(int i, int j)
	{
		if (i < 0 || j < 0)
			return 0;
		if (j == 0 || i == j)
			return 1;
		return mysterySeries(i - 1, j) + mysterySeries(i - 1, j - 1);
	}
	
	public static double goldenRatio(int n)
	{
		if (n == 0)
			return 1;
		return 1 + (1 / goldenRatio(n - 1));
	}
	
	public static int fileCount(File file)
	{
		if (file.isFile()) {
			return 1;
		}
		
		int sum = 1;
		for (File subFile : file.listFiles()) {
			sum += fileCount(subFile);
		}
		return sum;
	}

	public static void hanoi(int n, char src, char dest, char aux)
	{
		if (n == 0)
			return;
		hanoi(n - 1, src, aux, dest);
		System.out.printf("move %d from %s to %s\n", n, src, dest);
		hanoi(n - 1, aux, dest, src);
	}
	
	public static void main(String[] args) {
//		Power
//		System.out.print(power(3, 3));
//		Golden Ratio
//		System.out.print(goldenRatio(100));
//		MysterySeries
//		System.out.print(mysterySeries(4, 3));
//		Hanoi
		hanoi(4, 'A', 'C', 'B');
	}

}
